Skip to content

Conversation

@Tarquinen
Copy link
Collaborator

Summary

  • Fix tool result counting to not re-count already-pruned tools when a session is restarted
  • Properly clear tool tracker state (seenToolResultIds, skipNextIdle) when switching sessions

Details

When restarting a session, the tool cache sync was counting all tool results again, including those that had already been pruned. This could cause the pruning threshold to be reached prematurely.

This fix:

  1. Adds a clearToolTracker function that resets all tracker state when switching sessions
  2. Modifies syncToolCache to skip already-pruned tools when counting toward the nudge threshold
  3. Removes unused PruneReason import from janitor.ts

Version bump: 0.4.15 → 0.4.16

@Tarquinen Tarquinen merged commit 8d30228 into master Dec 11, 2025
1 check passed
@Tarquinen Tarquinen deleted the fix/tool-count-on-restart branch December 11, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants